package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.address.TbAreasMapper;
import com.dongdongshop.pojo.address.TbAddressExample;
import com.dongdongshop.pojo.cities.TbAreas;
import com.dongdongshop.pojo.cities.TbAreasExample;
import com.dongdongshop.service.address.AreasServiceI;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Service
public class AreasServiceImpl implements AreasServiceI {
    @Resource
    private TbAreasMapper areasMapper;

    @Override
    public List<TbAreas> getArea(String areaId) {
        TbAreasExample areasExample=new TbAreasExample();
        TbAreasExample.Criteria criteria = areasExample.createCriteria();
        criteria.andCityidEqualTo(areaId);
        return areasMapper.selectByExample(areasExample);
    }

    @Override
    public TbAreas getById(String townId) {
        return areasMapper.getById(townId);
    }
}
